from sys import stdin
stdread = stdin.read()
nstr = stdread.split()

for i in nstr[1:]:
    if i[-1] == "0":
        print("E")
    else:
        print("B")